﻿using System;
using MySqlBackUp.Server.Core;

namespace MySqlBackUp.Server
{
    internal class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("MySql Database BackUp!!!");
            Console.WriteLine("========================");
            Console.WriteLine("Command:");
            Console.WriteLine("【开始】>start");
            Console.WriteLine("【停止】>stop");
            Console.WriteLine("【重启】>reload");
            Console.WriteLine("【配置】>conf");
            Console.WriteLine("【退出】>exit");
            Console.WriteLine("Please enter the command:");
            while (true)
            {
                var command = Console.ReadLine();
                switch (command)
                {
                    case "start":
                        ExecHelper.Start();
                        break;
                    case "stop":
                        ExecHelper.Stop();
                        break;
                    case "reload":
                        ExecHelper.Reload();
                        break;
                    case "conf":
                        ExecHelper.OpenConf();
                        break;
                    case "exit":
                        Environment.Exit(0);
                        break;
                    default:
                        Console.WriteLine("Error command");
                        break;
                }
            }
        }
    }
}
